define([
        'underscore',
        'app/utils/HttpClientUtils',
        'app/utils/WebUtils',
        'app/utils/CommonUtils'
        ], function (
		_,
		hc,
		WebUtils
        
    ) {

	var s = {};
	
	
	///page init start
	s.wjt_admin_catalog_init = function(param, callback_func){
		var url = "wjt/wjt_admin_catalog_init";
		var body = {
			
		};
		hc.sendPOST(url,body,function(resp){
			callback_func(resp);
		},null,true);
	};
	
	s.wjt_chairinvite_init = function(param, callback_func){
		var url = "wjt/wjt_chairinvite_init";
		var body = {
			roomuuid:param.roomuuid
		};
		hc.sendPOST(url,body,function(resp){
			callback_func(resp);
		},null,true);
		
	};
	s.wjt_user_init = function(param, callback_func){
		var url = "wjt/wjt_user_init";
		var body = {
			useruuid:param.useruuid
		};
		hc.sendPOST(url,body,function(resp){
			callback_func(resp);
		},null,true);
		
	};
	s.admin_setting_init = function(p,callback_func){
		var useruuid = $.val_trim(p.useruuid);
		var url = "wjt/admin_setting";
		var body = {
			useruuid:useruuid
		};
		hc.sendPOST(url,body,function(resp){
			callback_func(resp);
		},null,true);
	};

	s.wjt_create_init = function(param,callback_func){
		var useruuid = $.val_trim(param.useruuid);
		var url = "wjt/wjt_create_init";
		var body = {
			useruuid:useruuid
		};
		hc.sendPOST(url,body,function(resp){
			callback_func(resp);
		},null,true);
	};
	s.wjt_room_details_init = function(param,callback_func){
		var useruuid = $.val_trim(param.useruuid);
		var roomuuid = $.val_trim(param.roomuuid);
		var url = "wjt/wjt_room_details_init";
		var body = {
			useruuid:useruuid,
			roomuuid:roomuuid
		};
		hc.sendPOST(url,body,function(resp){
			callback_func(resp);
		},null,true);
	};
	
	s.wjt_admin_init = function(param,callback_func){
		var useruuid = $.val_trim(param.useruuid);
		var s = $.val_trim(param.s);
		var p = $.val_trim(param.p);
		var w = $.val_trim(param.w);
		var c = $.val_trim(param.c);
		var url = "wjt/wjt_admin_init";
		var body = {
			useruuid:useruuid,
			s:s,
			p:p,
			w:w,
			c:c
		};
		hc.sendPOST(url,body,function(resp){
			callback_func(resp);
		},null,true);
	};
	
	s.wjt_admin_member_init = function(param,callback_func){
		var useruuid = $.val_trim(param.useruuid);
		var s = $.val_trim(param.s);
		var p = $.val_trim(param.p);
		var w = $.val_trim(param.w);
		var url = "wjt/wjt_admin_member_init";
		var body = {
			useruuid:useruuid,
			s:s,
			p:p,
			w:w
		};
		hc.sendPOST(url,body,function(resp){
			callback_func(resp);
		},null,true);
	}
	///page init end
	
	s.wx_setting_save = function(p,callback_func){
		var wx_id = $.val_trim(p.wx_id);
		var wx_secret = $.val_trim(p.wx_secret);
		var wx_open_id = $.val_trim(p.wx_open_id);
		var wx_open_secret = $.val_trim(p.wx_open_secret);
		var useruuid = $.val_trim(p.useruuid);
		
		var url = "wjt/wx_setting_save";
		var body = {
			"useruuid":useruuid,
			"wx_id":wx_id,
			"wx_secret":wx_secret,
			"wx_open_id":wx_open_id,
			"wx_open_secret":wx_open_secret
		};
		
		hc.sendPOST(url,body,function(resp){
			callback_func(resp);
		},null,true);
		
	};

	
	s.wx_setting_adminpwd_update = function(p,callback_func){
		var useruuid = $.val_trim(p.useruuid);
		var wjt_adminpwd_old = $.val_trim(p.wjt_adminpwd_old);
		var wjt_adminpwd_new = $.val_trim(p.wjt_adminpwd_new);
		var wjt_adminpwd_new2 = $.val_trim(p.wjt_adminpwd_new2);
		var url = "wjt/admin_pwd_update";
		var body = {
			useruuid:useruuid,
			wjt_adminpwd_old:wjt_adminpwd_old,
			wjt_adminpwd_new:wjt_adminpwd_new,
			wjt_adminpwd_new2:wjt_adminpwd_new2
		};
		hc.sendPOST(url,body,function(resp){
			callback_func(resp);
		},null,true);
	};
	s.wjt_admin_sysinfo_save = function(p,callback_func){
		var useruuid = $.val_trim(p.useruuid);
		var wjt_admin_copyright = $.val_trim(p.wjt_admin_copyright);
		var wjt_admin_attachment_path = $.val_trim(p.wjt_admin_attachment_path);
		var wjt_admin_web_hostname = $.val_trim(p.wjt_admin_web_hostname);
		var url = "wjt/admin_sysinfo_save";
		var body = {
			useruuid:useruuid,
			wjt_admin_copyright:wjt_admin_copyright,
			wjt_admin_attachment_path:wjt_admin_attachment_path,
			wjt_admin_web_hostname:wjt_admin_web_hostname
		};
		hc.sendPOST(url,body,function(resp){
			callback_func(resp);
		},null,true);
	};
	s.wjt_room_basic_update = function(param, callback_func){
		
		var url = "wjt/wjt_room_basic_update";
		var body = param;
		
		hc.sendPOST(url,body,function(resp){
			callback_func(resp);
		},null,true);
	}
	s.wjt_roomcreate = function(param, callback_func){
		var useruuid = $.val_trim(param.useruuid);
		var name = $.val_trim(param.name);
		var starttime = $.val_trim(param.starttime);
		var createpwd = $.val_trim(param.createpwd);
		var cataloguuid = $.val_trim(param.cataloguuid);
		var url = "wjt/wjt_roomcreate";
		var body = {
			useruuid:useruuid,
			name:name,
			starttime:starttime,
			createpwd:createpwd,
			cataloguuid:cataloguuid
		};
		hc.sendPOST(url,body,function(resp){
			callback_func(resp);
		},null,true);
		
	};

	s.room_lecturepage_video_save = function(param, callback_func){
		var url = "wjt/room_lecturepage_video_save";
		var body = {
				id:param.id,
				pageurl:param.pageurl,
				roomuuid:param.roomuuid
		};
		hc.sendPOST(url,body,function(resp){
			callback_func(resp);
		},null,true);
	};
	
	//以下
	s.room_video_transcoding = function(param, callback_func){
		var url = "wjt/room_video_transcoding";
		var body = {
				id:param.id,
				pageurl:param.pageurl,
				roomuuid:param.roomuuid
		};
		hc.sendPOST(url,body,function(resp){
			callback_func(resp);
		},null,true);
	};
	//以上
	
	s.lecture_page_order_update = function(param, callback_func){
		var url = "wjt/lecture_page_order_update";
		var body = {
				id:param.id,
				num:param.num
		}
		hc.sendPOST(url,body,function(resp){
			callback_func(resp);
		},null,true);
	}
	s.lecture_page_delete = function(param, callback_func){
		var url = "wjt/lecture_page_delete";
		var body = {
				id:param.id
		}
		hc.sendPOST(url,body,function(resp){
			callback_func(resp);
		},null,true);
	}
	s.wjt_lecture_ratio_update=function(param, callback_func){
		var url = "wjt/wjt_lecture_ratio_update";
		var body = {
				useruuid:param.useruuid,
				roomuuid:param.roomuuid,
				ratio:param.ratio
		}
		hc.sendPOST(url,body,function(resp){
			callback_func(resp);
		},null,true);
		
	};
	
	s.room_staging=function(param, callback_func){
		
		var url = "wjt/room_staging";
		var body = {
			useruuid:param.useruuid,
			roomuuid:param.roomuuid,
			staging:param.staging
		};
		
		hc.sendPOST(url,body,function(resp){
			callback_func(resp);
		},null,true);
		
	};

	s.room_pwd_switch = function(param, callback_func){

		var url = "wjt/room_pwd_switch";
		var body = {
			useruuid:param.useruuid,
			roomuuid:param.roomuuid,
			pwd:param.pwd
		};
		
		hc.sendPOST(url,body,function(resp){
			callback_func(resp);
		},null,true);
	}
	
	//userinfo
	s.userinfo_create = function(param, callback_func){
		var url = "wjt/userinfo_create";
		var body = {
			name:param.name,
			email:param.email,
			phone:param.phone,
			pwd:param.pwd,
			thumb:param.thumb
		};
		
		hc.sendPOST(url,body,function(resp){
			callback_func(resp);
		},null,true);
	};
	s.userinfo_udpate = function(param, callback_func){
		var url = "wjt/userinfo_udpate";
		var body = {
			useruuid:param.useruuid,
			name:param.name,
			email:param.email,
			phone:param.phone
		};
		
		hc.sendPOST(url,body,function(resp){
			callback_func(resp);
		},null,true);
	};
	s.userinfo_pwd_update = function(param, callback_func){
		var url = "wjt/userinfo_pwd_update";
		var body = {
			useruuid:param.useruuid,
			wjt_user_pwd_old:param.wjt_user_pwd_old,
			wjt_user_pwd_new:param.wjt_user_pwd_new,
			wjt_user_pwd_new2:param.wjt_user_pwd_new2
		};
		
		hc.sendPOST(url,body,function(resp){
			callback_func(resp);
		},null,true);
	}
	s.userinfo_admin_pwd_update =function(param, callback_func){
		var url = "wjt/userinfo_admin_pwd_update";
		var body = {
			useruuid:param.useruuid,
			wjt_user_pwd_new:param.wjt_user_pwd_new
		};
		
		hc.sendPOST(url,body,function(resp){
			callback_func(resp);
		},null,true);
	}
	s.wjt_delete_room = function(param, callback_func){
		var url = "wjt/wjt_delete_room";
		var body = {
			roomuuid:param.roomuuid
		};
		
		hc.sendPOST(url,body,function(resp){
			callback_func(resp);
		},null,true);
	}
	
	s.doLogin = function(param, callback_func){
		var url = "wjt/dologin";
		var body = {
			email:$.val_trim(param.email),
			pwd:$.val_trim(param.pwd)
		};
		hc.sendPOST(url,body,function(resp){
			callback_func(resp);
		},null,true);
	};
	
	
	
	s.wjt_removechair = function(param, callback_func){
		
		var url = "wjt/wjt_removechair";
		var body = {
			useruuid:$.val_trim(param.useruuid),
			roomuuid:$.val_trim(param.roomuuid)
		};
		hc.sendPOST(url,body,function(resp){
			callback_func(resp);
		},null,true);
	};
	
	s.wjt_addchair = function(param, callback_func){
		
		var url = "wjt/wjt_addchair";
		var body = {
			email:$.val_trim(param.email),
			roomuuid:$.val_trim(param.roomuuid)
		};
		hc.sendPOST(url,body,function(resp){
			callback_func(resp);
		},null,true);
	};
	
	s.catalog_order_update = function(param, callback_func){
		var url = "wjt/catalog_order_update";
		var body = param;
		hc.sendPOST(url,body,function(resp){
			callback_func(resp);
		},null,true);
	}
	s.catalog_order_save = function(param, callback_func){
		var url = "wjt/catalog_order_save";
		var body = param;
		hc.sendPOST(url,body,function(resp){
			callback_func(resp);
		},null,true);
	}
	s.catalog_change = function(param, callback_func){
		var url = "wjt/catalog_change";
		var body = param;
		hc.sendPOST(url,body,function(resp){
			callback_func(resp);
		},null,true);
	}
	s.catalog_del = function(param, callback_func){
		var url = "wjt/catalog_del";
		var body = param;
		hc.sendPOST(url,body,function(resp){
			callback_func(resp);
		},null,true);
	}
	return s;
});
